package com.heima.model.article.dots;

import com.heima.model.common.annotation.IdEncrypt;
import lombok.Data;

import java.util.Date;

@Data
public class CollectionBehaviorDto {
    @IdEncrypt
    private Long entryId;
    private Short operation;
    private Date publishedTime;
    private Short type;
    public enum Operation{
        COLLECTION((short)0),
        CANCEL((short)1);
        private Short value;
        Operation(Short value)
        {
            this.value=value;
        }
        public Short getValue()
        {
            return this.value;
        }
        public static boolean check(Short value)
        {
            if (value==null)
                return false;
            if (value!= COLLECTION.value&&value!= CANCEL.value)
                return false;
            return true;
        }
    }
    public enum Type{
        ARTICLE((short)0),
        DYNAMIC((short)1);
        private Short value;
        Type(Short value)
        {
            this.value=value;
        }
        public Short getValue(){
            return this.value;
        }
        public static boolean check(Short value)
        {
            if (value==null)
                return false;
            if (value!=ARTICLE.value&&value!= DYNAMIC.value)
                return false;
            return true;
        }

    }
}
